package com.carrot.mq.mqserver.mapper;

import com.carrot.mq.mqserver.core.Binding;
import com.carrot.mq.mqserver.core.Exchange;
import com.carrot.mq.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/7/31 20:29
 */
@Mapper
public interface MetaMapper {
    // 建表
    void createExchangeTable();
    void createQueueTable();
    void createBindingTable();

    // 插入、查找和删除操作
    void insertExchange(Exchange exchange);
    List<Exchange> selectAllExchanges();
    void deleteExchange(@Param("name") String exchangeName);
    void insertQueue(MSGQueue msgQueue);
    List<MSGQueue> selectAllQueues();
    void deleteQueue(@Param("name") String queueName);
    void insertBinding(Binding binding);
    List<Binding> selectAllBindings();
    void deleteBinding(Binding binding);
}
